package com.luo.dao.impl;

import com.luo.dao.HotMappers;
import com.luo.model.Goods;
import com.luo.model.recommend;
import com.luo.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * 功能：
 * 作者：Luo。
 * 日期：2024/1/9 18:04
 */
public class HotDaoImpl implements HotMappers {

    @Override
    public List<recommend> queryRecommend() {
        SqlSession sqlSession = SqlSessionUtil.getSqlSession();
        HotMappers mapper = sqlSession.getMapper(HotMappers.class);
        List<recommend> recommends = mapper.queryRecommend();
        sqlSession.close();
        return recommends;
    }

    public List<Goods> queryHotGoods(){
        SqlSession sqlSession = SqlSessionUtil.getSqlSession();
        HotMappers mapper = sqlSession.getMapper(HotMappers.class);
        List<Goods> recommends = mapper.queryHotGoods();
        sqlSession.close();
        return recommends;
    }
}
